#include <cstring>
#include <iostream>
using namespace std;

int M, X;
double P;
constexpr int MAXN = 10;
double dp[2][1 << MAXN + 1];

void solve() {
    int n = 1 << M;
    double *pre = dp[0], *nxt = dp[1];
    memset(pre, 0, sizeof(double) * (n + 1));
    pre[n] = 1.0;
    for (int r = 0; r < M; r++) {
        for (int i = 0; i <= n; i++) {
            int jub = min(i, n - i);
            double t = 0.0;
            for (int j = 0; j <= jub; j++) {
                t = max(t, P * pre[i + j] + (1 - P) * pre[i - j]);
            }
            nxt[i] = t;
        }
        swap(pre, nxt);
    }
    int i = (long long) X * n / 1000000;
    cout << i << endl;

}